package kr.hkit.androidcomplete03.ch23;


import kr.hkit.androidcomplete03.R;
import kr.hkit.androidcomplete03.R.array;
import kr.hkit.androidcomplete03.ch20.Ch20ActivityMain;
import kr.hkit.androidcomplete03.ch21.Ch21ActivityMain;
import kr.hkit.androidcomplete03.ch22.Ch22ActivityMain;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;

public class Ch23ActivityMain extends ListActivity {
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		
		ArrayAdapter adapter = ArrayAdapter.createFromResource(this, R.array.chapter23, android.R.layout.simple_list_item_1);
		setListAdapter(adapter);
	}
	
	@Override
	protected void onListItemClick(ListView l, View v, int position, long id) {
		Intent intent= null;
		switch (position) {
		case 0:
			intent = new Intent(this, FrameAni.class);
			break;
		case 1:
			intent = new Intent(this, AnimationTest.class);
			break;
		}
		startActivity(intent);
	}
}
